/**
 * keywordStats mongoose dao(CURD)
 */

var mongoose = require('mongoose'),
    Schema = mongoose.Schema,
    wechatStatSchema;
var ObjectId = require('mongoose').Types.ObjectId;
//var wechat = mongoose.createConnection('mongodb://scrapy:scrapy.pwd@111.204.165.5:27017/scrapy');
var wechat = mongoose.createConnection('mongodb://contentbank:ContentBank4.2@111.204.165.5:27017/contentbank');

// 完整的keywords
wechatStatSchema = new Schema({
    "stat_time": String,
    'keyword_id':String,
    'title':String,
    //微信正负向 (正向+负向+中立)
    "wechat_tendency": [
        {
            "positive": Number,
            "negative": Number,
            "neutral": Number
        }
    ],

    //微信阅读量/点赞量 （日期+阅读量+点赞量）
    "wechat_playlike": [{
        "date": String,
        "read_num": Number,
        "like_num": Number
    }],
    //微博指数关联词 （关键词1+关键词2+权重）
    "wechat_relate_words":  [
        {
            "dianshitai": [],
            "shipinwangzhan": [],
            "jiemu": [],
            "menhuwangzhan": [],
            "zhuanyemeiti": [],
            "zhimei": [],
            "pinpai": [],
            "zimeiti": []
        }
    ]
});


//静态方法


//实例方法

//索引

//虚拟方法
//


// 激活model
var WechatStat = wechat.model('wechat_stat', wechatStatSchema),w = new WechatStat;
w.save(function(){
    console.log('wechat_stat连接成功');
});



exports.WechatStat = WechatStat;
